﻿namespace RBAC.Read.Api.MYSQL
{
    public interface IDatabaseBackupService
    {
        /// <summary>
        /// 备份数据库
        /// </summary>
        /// <param name="backupPath">备份文件路径</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns>是否成功</returns>
        Task<bool> BackupDatabaseAsync(string backupPath, CancellationToken cancellationToken = default);

        /// <summary>
        /// 恢复数据库
        /// </summary>
        /// <param name="backupPath">备份文件路径</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns>是否成功</returns>
        Task<bool> RestoreDatabaseAsync(string backupPath, CancellationToken cancellationToken = default);

        /// <summary>
        /// 列出所有备份文件
        /// </summary>
        /// <param name="backupDirectory">备份目录</param>
        /// <returns>备份文件列表</returns>
        Task<IEnumerable<string>> ListBackupsAsync(string backupDirectory);
    }
}
